package com.telit.firecommand.controller.pub;//package com.telit.firecommand.controller.pub;
//
//import com.telit.constant.Constant;
//import com.telit.dto.XjCategoryDTO;
//import com.telit.dto.XjMemDTO;
//import com.telit.dto.XjUserDTO;
//import com.telit.entity.DataReturn;
//import com.telit.entity.PageData;
//import com.telit.model.xj.SaveXjMemRequest;
//import com.telit.model.xj.SaveXjUserRequest;
//import com.telit.service.DistrictService;
//import com.telit.service.XjService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//
///**
// * 叙简平台开放API（用于配置续简账号）
// *
// * @author yuezhuang
// * @date 2022-10-14
// */
//@Slf4j
//@RequiredArgsConstructor
//@RestController
//@RequestMapping(value = "/pub/xj", produces = MediaType.APPLICATION_JSON_VALUE)
//@Api(tags = "叙简平台开放API", value = "叙简平台开放API", produces = MediaType.APPLICATION_JSON_VALUE)
//public class XjPubController {
//
//    private final XjService xjService;
//
//    private final DistrictService districtService;
//
//    // ========================= 续简用户管理 =========================
//
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_POST, value = "保存续简用户")
//    @PostMapping(path = "/save")
//    public DataReturn<XjUserDTO> save(@RequestBody SaveXjUserRequest saveXjUserRequest) {
//        return DataReturn.ok(xjService.save(saveXjUserRequest));
//    }
//
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_POST, value = "删除续简用户")
//    @PostMapping(path = "/del/{id}")
//    public DataReturn<?> del(@PathVariable(value = "id") Long id) {
//        xjService.del(id);
//        return DataReturn.ok();
//    }
//
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "查询续简用户详情")
//    @GetMapping(path = "/detail/{id}")
//    public DataReturn<XjUserDTO> detail(@PathVariable(value = "id") Long id) {
//        return DataReturn.ok(xjService.detail(id));
//    }
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "page", value = "当前页，分页当前页", required = true, paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "limit", value = "分页条数", required = true, paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "noPage", value = "是否不分页，true-不分页", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "userName", value = "系统用户名称", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "xjUsername", value = "叙简用户名称", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "status", value = "状态：0-正常 1-冻结", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "type", value = "类型：1-web 2-app", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "xjMemTel", value = "叙简设备呼号", paramType = "query", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "查询续简用户列表")
//    @GetMapping(path = "/qry-user-list")
//    public DataReturn<PageData<List<XjUserDTO>>> qryUserList(@RequestParam(value = "page") Integer page,
//                                                             @RequestParam(value = "limit") Integer limit,
//                                                             @RequestParam(value = "noPage", required = false) boolean noPage,
//                                                             @RequestParam(value = "userName", required = false) String userName,
//                                                             @RequestParam(value = "xjUsername", required = false) String xjUsername,
//                                                             @RequestParam(value = "status", required = false) Integer status,
//                                                             @RequestParam(value = "type", required = false) Integer type,
//                                                             @RequestParam(value = "xjMemTel", required = false) String xjMemTel) {
//        return DataReturn.ok(xjService.qryUserList(page, limit, noPage, userName, xjUsername, status, type, xjMemTel));
//    }
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "userId", value = "登录用户id", required = true, paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "type", value = "类型 1-web端 2-app端", required = true, paramType = "query", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "查询叙简登录账号密码")
//    @GetMapping(path = "/qry-user")
//    public DataReturn<XjUserDTO> qryUser(@RequestParam(value = "userId") Long userId,
//                                         @RequestParam(value = "type") Integer type) {
//        return DataReturn.ok(xjService.qryUser(userId, type));
//    }
//
//
//    // ========================= 续简设备管理 =========================
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "pageNo", value = "当前页数", defaultValue = "1", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "pageSize", value = "每页条数", defaultValue = "20", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "ptDeptId", value = "统一平台 部门id", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "xjCategoryId", value = "叙简分类id", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "areaCode", value = "所属区域编码", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "noPage", value = "是否不分页 true-不分页", paramType = "query", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "WEB端查询设备列表")
//    @GetMapping(path = "/qry-mems")
//    public DataReturn<PageData<List<XjMemDTO>>> qryMems(
//            @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
//            @RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize,
//            @RequestParam(value = "ptDeptId", required = false) Long ptDeptId,
//            @RequestParam(value = "xjCategoryId", required = false) Long xjCategoryId,
//            @RequestParam(value = "areaCode", required = false) String areaCode,
//            @RequestParam(value = "noPage", required = false, defaultValue = "false") boolean noPage) {
//        return DataReturn.ok(xjService.qryMems(pageNo, pageSize, ptDeptId, null, areaCode, xjCategoryId, noPage, 1));
//    }
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", value = "id", paramType = "path", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "查询设备详情")
//    @GetMapping(path = "/mem-info/{id}")
//    public DataReturn<XjMemDTO> memInfo(@PathVariable(value = "id") Long id) {
//        return DataReturn.ok(xjService.memInfo(id));
//    }
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "regionCode", value = "行政编码", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "hasDefaultDept", value = "是否设置默认顶级树节点名称", paramType = "query", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "非鉴权获取部门树形列表")
//    @GetMapping(path = "/dept/queryDeptTrees")
//    public DataReturn queryDeptTrees(@RequestParam(value = "regionCode") String regionCode,
//                                     @RequestParam(value = "hasDefaultDept") Boolean hasDefaultDept) {
//        return DataReturn.ok(xjService.queryDeptTrees(regionCode, hasDefaultDept));
//    }
//
////    @ApiImplicitParams({
////            @ApiImplicitParam(name = "district", value = "行政编码", paramType = "path", dataType = "String"),
////    })
////    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "非鉴权获取行政区划树")
////    @GetMapping(path = "/district/districtTree/{district}")
////    public DataReturn queryDeptTrees(@PathVariable(value = "district") String district) {
////        return DataReturn.ok(districtService.qryAllByParentCode(district));
////    }
//
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_POST, value = "保存续简设备")
//    @PostMapping(path = "/save-mem")
//    public DataReturn<XjMemDTO> saveMemInfo(@RequestBody SaveXjMemRequest saveXjMemRequest) {
//        return DataReturn.ok(xjService.saveMemInfo(saveXjMemRequest));
//    }
//
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "删除续简设备")
//    @GetMapping(path = "/del-mem/{id}")
//    public DataReturn<?> deleteMem(@PathVariable(value = "id") Long id) {
//        xjService.deleteMem(id);
//        return DataReturn.ok();
//    }
//
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "areaCode", value = "所属区域编码", paramType = "query", dataType = "String"),
//            @ApiImplicitParam(name = "withMems", value = "是否返回设备列表", defaultValue = "false", paramType = "query", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_GET, value = "查询设备类型树")
//    @GetMapping(path = "/qry-category-tree")
//    public DataReturn<List<XjCategoryDTO>> qryCategoryTree(
//            @RequestParam(value = "areaCode", required = false) String areaCode,
//            @RequestParam(value = "withMems", defaultValue = "false", required = false) boolean withMems) {
//        return DataReturn.ok(xjService.qryCategoryTree(areaCode, withMems));
//    }
//
//}
